<include file="Public:header" />
<style>
.header {
	display: none;
}.col-sm-12{margin:0; padding:0;}
</style>

<div class="container main">
<form class="checkoutform form-horizontal" action="{:U('saveText')}" method="post">
<input type="hidden" name="id" id="id" value="{$info.id}" >
<input type="hidden" name="name" value="{$name}" id="name">
<div class="setting_table">
  <div class="form-group">
    <div class="col-sm-12">
    
    <eq name="datatype" value="text">
    <html:editor id="editor" name="content" type="UEDIT" style="height:400px; width:100%;">内容加载中……</html:editor>
     
      
    </eq>
    
    
    
      
      <eq name="datatype" value="image">
    
      <img style="margin:0 auto; margin-top:10px; display:block; max-height:90px; vertical-align:top; max-width:100%;" onclick="showImgBox(this);" src="" id="img_url" />
      
      
     
      
    </eq>
      
    </div>
  </div>
  
  
  
  
  
  
  <eq name="datatype" value="image">
  <div class="form-group">
    <div class="col-sm-12">
    
    链接：
      <textarea class="form-control" style="height:50px; margin-top:10px;" name="link" id="link" type="text"><?php echo $diydata[$name.'_link'];?></textarea>
      
      
      
      
      
    </div>
  </div>
  </eq>
  
  
  
  
  
  
  
  
</div>
</div>
</div>
<div id="editcode" style="display:none;">
{$info.content}
</div>


<script>
<?php if(!isMobile()){?>

var ueditor = UE.getEditor('editor');
function getContent(){
	
    $('#editcode .wrap-box').eq(<?php echo $_GET['index'];?>).html(UE.getEditor('editor').getContent());
	
}


ueditor.addListener("ready", function () {
        // editor准备好之后才可以使用
        ueditor.setContent($('#editcode .wrap-box').eq(<?php echo $_GET['index'];?>).html());

});

<?php }else{?>

function getContent(){
	
    $('#editcode .wrap-box').eq(<?php echo $_GET['index'];?>).html($('#editor').code());
	
}
$('#editor').code($('#editcode .wrap-box').eq(<?php echo $_GET['index'];?>).html())

<?php }?>


$('#img_url').attr('src',$('#editcode .wrap-box').eq({$Think.get.index}).find('img').attr('src'));

   $('#link').val($('#editcode .wrap-box').eq({$Think.get.index}).find('a').attr('href'));
   
</script>

</body>
</html>
